< previous page page_550 next page >

Page 550
e10a6a0a59f035e870d90cca05b85fce.gif
Dim yj2 As Single
Dim zj2 As Single
Dim X As Single
Dim Y As Single
Dim z1 As Single
Dim z2 As Single

    num = target.NumPts 
    
    ' Check each edge in this polygon. 
    GetTransformedPoint NumPts, xi1, yi1, zi1 
    For i = 1 To NumPts 
        GetTransformedPoint i, xi2, yi2, zi2 

        ' Compare with each edge in the other. 
        target.GetTransformedPoint num, xj1, yj1, zj1
        For j = 1 To num
            target.GetTransformedPoint j, xj2, yj2, zj2
            ' See if the segments cross.
            If FindCrossing( _
                xi1, yi1, zi1, _
                xi2, yi2, zi2, _
                xj1, yj1, zj1, _
                xj2, yj2, zj2, _
                X, Y, z1, z2) _
            Then
                If z1 - z2 > 0.01 Then
                    ' z1 > z2. We obscure it.
                    Obscures = True
                    Exit Function
                End If
                If z2 - z1 > 0.01 Then
                    ' z2 > z1. It obscures us.
                    Obscures = False
                    Exit Function
                End If
            End If
             
            xj1 = xj2 
            yj1 = yj2 
            zj1 = zj2 
        Next j 
         
        xi1 = xi2 
        yi1 = yi2 
        zi1 = zi2 
    Next i 
     
    ' No edges cross. See if one polygon contains
    ' the other.
    ' 
    ' If any points of one polygon are inside the
    ' other, then they must all be. Since the

 
< previous page page_550 next page >